<!--
  @@-COPYRIGHT-START-@@

  Copyright (c) 2014 Qualcomm Atheros, Inc.
  All rights reserved.
  Qualcomm Atheros Confidential and Proprietary.

  @@-COPYRIGHT-END-@@
-->

<script type="text/javascript">//<![CDATA[
var HideAdvanced = 0;
var HideDiaglog = 0;
function onLBDAdvanced()
{
	var objAdv = document.getElementById("lbd-advanced");
	if (!objAdv)
		return;

	if (HideAdvanced)
	{
		HideAdvanced = 0;
		objAdv.value = "Hide Advanced Settings";
	}
	else
	{
		HideAdvanced = 1;
		objAdv.value = "Show Advanced Settings";
	}

	for (var i=0; i<objAdv.form.length; i++ )
	{
		var objElm = objAdv.form.elements[i];
		if (objElm.className == "cbi-section" &&
			(objElm.id == "cbi-lbd-StaDB_Adv"
				|| objElm.id == "cbi-lbd-StaMonitor_Adv"
				|| objElm.id == "cbi-lbd-BandMonitor_Adv"
				|| objElm.id == "cbi-lbd-Estimator_Adv"
				|| objElm.id == "cbi-lbd-SteerExec_Adv"
				|| objElm.id == "cbi-lbd-WlanIF2G_Adv"
				|| objElm.id == "cbi-lbd-WlanIF5G_Adv"
				|| objElm.id == "cbi-lbd-SteerAlg_Adv"))
		{
			if (HideAdvanced)
				objElm.style.display = "none";
			else
				objElm.style.display = "block";
		}
	}
}

function onLBDDiaglog()
{
	var objDiag = document.getElementById("lbd-diaglog");
	if (!objDiag)
		return;

	if (HideDiaglog)
	{
		HideDiaglog = 0;
		objDiag.value = "Hide Diagnostic Log Settings"
	}
	else
	{
		HideDiaglog = 1;
		objDiag.value = "Show Diagnostic Log Settings"
	}

	for (var i=0; i<objDiag.form.length; i++ )
	{
		var objElm = objDiag.form.elements[i];
		if (objElm.className == "cbi-section"
			&& objElm.id == "cbi-lbd-DiagLog")
		{
			if (HideDiaglog)
				objElm.style.display = "none";
			else
				objElm.style.display = "block";
		}
	}
}

function onLbdEnable()
{
	var objLbd = document.getElementById("cbid.lbd.config.Enable");
	var objSsid = document.getElementById("cbid.lbd.config.MatchingSSID");

	if (!objLbd || !objSsid)
		return;

	if(objLbd.checked == true)
	{
		objSsid.disabled = false;
	}
	else
	{
		objSsid.disabled = true;
	}
}

function onLBDLoad()
{
	var objLbd = document.getElementById("cbid.lbd.config.Enable");
	if (objLbd)
	{
		objLbd.onchange = onLbdEnable;
	}

	var objAdv = document.getElementById("lbd-advanced");
	if (objAdv)
	{
		objAdv.onclick = onLBDAdvanced;
	}

	var objDiag = document.getElementById("lbd-diaglog");
	if (objDiag)
	{
		objDiag.onclick = onLBDDiaglog;
	}

	onLbdEnable();
	onLBDAdvanced();
	onLBDDiaglog();
}

if (document.all)
	window.attachEvent('onload', onLBDLoad);
else
	window.addEventListener('load', onLBDLoad, false);
//]]></script>

